package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.ContractCompareEntity;
import com.xbongbong.saas.domain.entity.ContractEditFileEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author: yingjf
 * @date: 2023/3/7 18:47
 * @description:
 */
@Mapper
@Repository
public interface ContractEditFileDao {
    Long insert(ContractEditFileEntity entity);

    void insertBatch(List<ContractEditFileEntity> list);

    ContractEditFileEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer update(ContractEditFileEntity entity);

    List<ContractEditFileEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    ContractEditFileEntity getLastByFileId(@Param("fileId") String fileId);

    List<ContractEditFileEntity> getByFileIdAndFileVersion(@Param("corpid")String corpid,@Param("list")List<Map<String,String>> list);

    void updateFileNameByFileIdAndFileVersion(@Param("corpid")String corpid,@Param("fileId")String fileId,@Param("fileVersion")Integer fileVersion,@Param("fileName")String fileName);

    ContractEditFileEntity getOneByFileIdAndFileVersion(@Param("corpid")String corpid,@Param("fileId")String fileId,@Param("fileVersion")Integer fileVersion);
}
